﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using e.Store.Model.Entities;
using e.Store.DataAccess;

namespace e.Store.Domain.Repositories
{
    public class UserRepository : Repository<User>
    {

        public UserRepository(eStote_DBEntities context)
            : base(context)
        {
            dbSet = context.Set<User>();
        }

        public List<LoadAllUsersResult> LoadAllUsers()
        {
            return context.LoadAllUsers().ToList();
        }


        public List<User> GetAllUsers()
        {
            IQueryable<User> users;

            using (var context = new eStote_DBEntities())
            {
                // context.Database.Initialize(true);
                users = context.Users;
                return users.ToList();
            }

        }

        public void Dispose()
        {
            //context.Dispose();
        }
    }
}
